package com.aftersale.demo.controller;

import com.aftersale.demo.Utils.Result;
import com.aftersale.demo.entity.User;
import com.aftersale.demo.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value="初始界面",tags="初始界面")
@RestController//标注返回json或数据
public class LoginController {
    @Autowired
    UserService userService;
    @ApiOperation(value="登录",notes="登录")
    @RequestMapping("/login")
    public Result login(@RequestBody User user){
        return userService.login(user);
    }

    @RequestMapping("/register")
    @ApiOperation(value="注册",notes="注册")
    public Result register(@RequestBody User user){
        return userService.register(user);
    }


}